package com.fs.ibox_h.pojo;


import com.fs.ibox_h.util.DateUtil;

import java.util.Date;

public class Orders {
    Integer id;
    String ordersid;
    String usernameby;
    String usernamesell;
    Double oprice;
    String cname;
    String cimg;
    Date ordertime;
    public Orders() {}

    public Orders(Integer id, String ordersid, String usernameby, String usernamesell, Double oprice, String cname, String cimg, Date ordertime) throws Exception {
        this.id = id;
        this.ordersid = ordersid;
        this.usernameby = usernameby;
        this.usernamesell = usernamesell;
        this.oprice = oprice;
        this.cname = cname;
        this.cimg = cimg;
        this.ordertime = DateUtil.toDate(DateUtil.toString(ordertime));
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOrdersid() {
        return ordersid;
    }

    public void setOrdersid(String ordersid) {
        this.ordersid = ordersid;
    }

    public String getUsernameby() {
        return usernameby;
    }

    public void setUsernameby(String usernameby) {
        this.usernameby = usernameby;
    }

    public String getUsernamesell() {
        return usernamesell;
    }

    public void setUsernamesell(String usernamesell) {
        this.usernamesell = usernamesell;
    }

    public Double getOprice() {
        return oprice;
    }

    public void setOprice(Double oprice) {
        this.oprice = oprice;
    }

    public String getCname() {
        return cname;
    }

    public void setCname(String cname) {
        this.cname = cname;
    }

    public String getCimg() {
        return cimg;
    }

    public void setCimg(String cimg) {
        this.cimg = cimg;
    }

    public Date getOrdertime() {
        return ordertime;
    }

    public void setOrdertime(Date ordertime) {
        try {
            this.ordertime =  DateUtil.toDate(DateUtil.toString(ordertime));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public String toString() {
        return "Orders{" +
                "id=" + id +
                ", ordersid='" + ordersid + '\'' +
                ", usernameby='" + usernameby + '\'' +
                ", usernamesell='" + usernamesell + '\'' +
                ", oprice=" + oprice +
                ", cname='" + cname + '\'' +
                ", cimg='" + cimg + '\'' +
                ", ordertime=" + ordertime +
                '}';
    }
}
